<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/12/25
  Time: 10:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!-- f标签 取得jsp一些函数工具 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="f"%>
<!-- 格式化标签 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<% String path = request.getContextPath();%>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form id="updateFrom">
    <input type="hidden" name="bookId" value="${tBook.bookId}">
    书名:<input type="text" name="bookName" id="bookName" value="${tBook.bookName}"><br>

    作者:<select class="form-control" name="author" id="bookAuthor">
    <option value="-1">作者</option>
    <c:forEach items="${alist}" var="a">
        <option value="${a.authorId}" <c:if test="${a.authorId == tBook.author}">selected</c:if>>${a.firstName}${a.astName}</option>
    </c:forEach>
</select><br>
    </select><br>
    出版:
    <select class="form-control" name="publisher" id="bookPublisher">
        <option value="-1">出版</option>
        <c:forEach items="${list}" var="p">
            <option value="${p.pubId}" <c:if test="${p.pubId == tBook.publisher}">selected</c:if>>${p.pubName}</option>
        </c:forEach>
    </select><br>
    时间:<input type="date" name="bookDate" id="bookDate" value='<fmt:formatDate value="${tBook.bookDate}" pattern="yyyy-MM-dd"/>'><br>
    价格:<input type="text" name="bookPrice" id="bookPrice" value="${tBook.bookPrice}"><br>
    类型:
    <select class="form-control" name="bookCategory" id="bookCategory">
        <option value="-1">类型</option>

        <c:forEach items="${clist}" var="c">
            <option value="${c.catId}" <c:if test="${c.catId== tBook.bookCategory}">selected</c:if>>${c.catName}</option>
        </c:forEach>
    </select><br>
</form>
</body>
</html>
